// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_MST_WORKING_GROUP_PERSON
// * CreateDate    : 2011/9/27 13:27:06
// * Creater       : CodeSmith
// * LastChangeDate: 2011/9/27 13:27:06
// * LastChanger   : 2011/9/27 13:27:06
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Mst
{
/// <summary>
    /// MstWorkingGroupPerson
    /// </summary>
    public partial class MstWorkingGroupPersonBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objMstWorkingGroupPersonEntity">Entity</param>
        /// <returns>Entity</returns>
        public static MstWorkingGroupPersonEntity GetMstWorkingGroupPerson(MstWorkingGroupPersonEntity objMstWorkingGroupPersonEntity)
        {
            return DataAccess.SelectSingle<MstWorkingGroupPersonEntity>(objMstWorkingGroupPersonEntity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objMstWorkingGroupPersonEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertMstWorkingGroupPerson(MstWorkingGroupPersonEntity objMstWorkingGroupPersonEntity)
        {
            return DataAccess.Insert(objMstWorkingGroupPersonEntity);
        }

        public static bool InsertMstWorkingGroupPerson(List<MstWorkingGroupPersonEntity> objMstWorkingGroupPersonEntityList)
        {
            return DataAccess.Insert(objMstWorkingGroupPersonEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objMstWorkingGroupPersonEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateMstWorkingGroupPerson(MstWorkingGroupPersonEntity objMstWorkingGroupPersonEntity)
        {
            return DataAccess.Update(objMstWorkingGroupPersonEntity);
        }

        public static bool UpdateMstWorkingGroupPerson(List<MstWorkingGroupPersonEntity> objMstWorkingGroupPersonEntityList)
        {
            return DataAccess.Update<MstWorkingGroupPersonEntity>(objMstWorkingGroupPersonEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objMstWorkingGroupPersonEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteMstWorkingGroupPerson(MstWorkingGroupPersonEntity objMstWorkingGroupPersonEntity)
        {
            return DataAccess.Delete(objMstWorkingGroupPersonEntity);
        }

        public static bool DeleteMstWorkingGroupPerson(List<MstWorkingGroupPersonEntity> objMstWorkingGroupPersonEntityList)
        {
            return DataAccess.Delete<MstWorkingGroupPersonEntity>(objMstWorkingGroupPersonEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetMstWorkingGroupPersonAll()
        {
            return DataAccess.SelectAllDataSet<MstWorkingGroupPersonEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<MstWorkingGroupPersonEntity> GetMstWorkingGroupPersonAllList()
        {
            return DataAccess.SelectAll<MstWorkingGroupPersonEntity>();
        }
        #endregion

        #region Functions
        public static MstWorkingGroupEntity GetWorkingGroupByID(string ID)
        {
            if (string.IsNullOrEmpty(ID))
                return null;
            MstWorkingGroupEntity mWorkingGroup=new MstWorkingGroupEntity();
            mWorkingGroup.GroupId=ID;
            return DataAccess.SelectSingle<MstWorkingGroupEntity>(mWorkingGroup);
             
        }

        public static List<MstWorkingGroupPersonEntity> GetListMstWorkingGroupPersonByGroupID(string GroupID)
        {
            if (string.IsNullOrEmpty(GroupID))
                return null;
            string Sql = @"SELECT * FROM MST_WORKING_GROUP_PERSON WHERE GROUP_ID='"+GroupID+"' ";
            return DataAccess.Select<MstWorkingGroupPersonEntity>(Sql);
        }
        #endregion
    }
	
	
}	

